package com.kj.xuyuan.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kj.xuyuan.R;
import com.kj.xuyuan.model.JsonBean;

import java.util.List;

import androidx.annotation.Nullable;

public class SelectAddressAdapter extends BaseQuickAdapter<JsonBean, BaseViewHolder> {

    public SelectAddressAdapter() {
        super(R.layout.item_select_address);
    }

    @Override
    protected void convert(BaseViewHolder helper, JsonBean item) {
        helper.setText(R.id.tv_province,item.getName());
        TextView tvProvince = helper.getView(R.id.tv_province);
        if(item.isSelected()){
            tvProvince.setTextColor(mContext.getResources().getColor(R.color.white));
            tvProvince.setBackgroundResource(R.drawable.shape_pink2_corners_30);
        }else{
            tvProvince.setTextColor(mContext.getResources().getColor(R.color.color_333));
            tvProvince.setBackgroundResource(0);
        }
    }
}
